1. Field of the Invention
The present invention relates to a method of executing, for example, a virtual machine and multiple guest operating systems through logical partitioning in a single computer. More particularly, the invention relates to a method of allocating a device(s) to the guest operating system.
2. Description of the Related Art
Techniques for configuring a virtual machine (VM) in a single computer to parallel execute multiple operating systems have begun to be popularly used. In a broad sense, the techniques each include two systems, a virtual machine system and a logical partition (LPAR) system. An operating system that is executed in these techniques, hereinbelow, will be referred to as a “guest OS.”
In the virtual machine system, a control software product so-called “virtual machine monitor” (“VMM,” hereinbelow) virtualizes special registers (control registers) controlling the operation of the hardware and processor of the computer, thereby creating multiple virtual machines. The guest OS runs in the respective virtual machine created by the VMM. More specifically, the VMM traps and emulates privileged instructions of the CPU (control processing unit), such as I/O (input/output) instructions for the execution of the guest OS and control register operations, thereby creating virtual machine environments. In the virtual machine system, the multiple guest OSs are enabled to share a sing I/O device. This is because an access to the virtual I/O device visible or recognizable from the guest OSs is trapped by the VMM, and the access is converted to an access to a real device and is emulated. Thereby, a flexible virtual machine environment low in dependency on the I/O device mounted in the computer.
In the execution of I/O control in the virtual machine system, overhead occurs since the VMM emulates an I/O operation performed by a respective guest OS (of a guest). In addition, since the VMM emulates also an I/O operation of an other guest OS running in the parallel execution, the overhead depends on the process of the other guest OS. Hence, there is a problem that it is difficult to carry out the performance prediction.
In the logical partition system, control software called “hypervisor” logically partitions computer resources thereby creating multiple computers. The hypervisor operates, for example, tables and registers that are referenced by a processor and other hardware, thereby logically partitioning the computer. The guest OS executes within a partition logically partitioned by the hypervisor. An instruction to be executed by the guest OS is not emulated and is directly executed by the processor. Hence, the guest OS is less likely to be influenced by an other guest OS executing in the same computer, whereby a virtual machine environment with high performance and high reliability can be realized. On the other hand, however, multiple virtual machines are created through partitioning of hardware resources, so that the I/O device cannot be shared by the multiple guest OSs. In the logical partition system, in order that the I/O device is shared among the guests, corresponding measurements have to be taken on the device side.
As described above, in the virtual machine system, virtual machines to be executed by the respective guest OSs are configured through emulation of privileged instructions; and in the logical partition system, the virtual machines OSs are configured through partitioning of the computer by the hypervisor.
Conventionally, techniques such as described above have been realized in a mainframe. This is attributed to the situation in which, in order to realize these techniques with high performance, special hardware resources, such as a processor corresponding to the virtual machine and mechanisms for executing emulation processes of the VMM by use of hardware, are necessary. However, with recent enhancement in processor performance, a sufficient performance can be obtained even from execution of processes such as described above in the processor. As a consequence, the systems, such as virtual machine and logical partition, have begun to be popularly employed for use with general computers other than mainframes.
The virtual machine system has a feature in that a guest OS in execution can be moved (migrated) into an other or distinct computer running through a VMM. As such, in a configuration formed such that the VMM in the migration destination emulate an I/O device necessary for the guest OS, the guest OS can be continually executed in the computer in the movement destination.
With the use of these techniques, high availability systems are implemented with the integration of systems running in martensite computers into a single computer, load balance associated with guest OS migration corresponding to the computer load, and guest OS migration in the event of computer failure.
Further, in the virtual machine system, there are implemented hardware mechanisms that enable direct operation of the I/O device from the guest OS. One of the mechanisms is an I/O address translation mechanism. Normally, when specifying data transfer by direct memory access (“DMA,” hereinbelow) on the I/O device, the OS specifies a physical address of the data transfer destination to the I/O device. In the event that the OS runs in the virtual machine, the physical address specified by the guest OS is a physical address virtualized by the VMM, which is not a real address. On the other hand, however, a physical address space recognizable from the device is a real physical address space. The I/O address translation mechanism translates the transfer destination address of the DMA transfer in correspondence to the guest OS using the device, thereby enabling the data to be transferred to a physical address area allocated to the guest OS. As such, in the event that the I/O address translation mechanism is specified by the VMM in accordance with, for example, the configuration and memory allocation state of the guest OS, the guest OS is enabled to directly issue the I/O specification to the device even without knowing about the physical address. Such an I/O address translation mechanism has been realized (For example, refer to “AMD I/O Virtualization Technology (IOMMU) Specification,” pp. 14, “2.2.5 Virtual Machine Guest Access to Devices,” [online], February 2006 Issue, AMD (USA), Retrieved on Jul. 24, 2006, Internet URL:
http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/34434.pdf).
Further, U.S. Pat. No. 4,887,202 discloses a switching method that switches an I/O device being used by a guest OS in a direct use mode to a VMM-emulation use mode or that conversely switches the I/O device being used in the VMM-emulation use mode to the mode of direct allocation to the guest OS.